<table width="100%"><tr><td width="20%">
<a href="../index.html">&lt; index</a><br />
<a href="index.html">&lt; 12. Field of view toolkit</a><br />
<a href="fov_get.html">&lt; 12.3 Reading fov information</a>
</td><td width="60%">
<p align="center">
=====================================<br />
12.4 Destroying a map<br />
=====================================<br />
</p></td><td width="20%">
</td></tr></table>
<style type="text/css">
.code { color:#444444; background-color:#EEEEEE;}
pre { color:#444444; background-color:#EEEEEE;}
table.param td { border : 1px solid #000000; }
th { background-color: #44BBFF; color: #FFFFFF }
table.none td { border : 0 }
</style>
To release the resources used by a map, destroy it with :<br />
<p class="code"><pre>
C++ : TCODMap::~TCODMap()
C   : void TCOD_map_delete(TCOD_map_t map)
Py  : map_delete(map)
</pre></p>
<table class="param">
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>map</td><td>In the C version, the map handler returned by the TCOD_map_new function.</td></tr>
</table>
<br />
Example :<br />
<p class="code"><pre>
C++ : TCODMap *map = new TCODMap(50,50); // allocate the map
      map->setCanSeeThrough(10,10,true); // set a cell as 'empty'
      map->computeFov(10,10); // calculate fov from the cell 10x10
	  bool visible=map->isInFov(10,10); // is the cell 10x10 visible ?
	  delete map; // destroy the map      
C   : TCOD_map_t map = TCOD_map_new(50,50);
      TCOD_map_set_can_see_through(map,10,10,true);
      TCOD_map_compute_fov(map,10,10);
      bool visible = TCOD_map_is_in_fov(map,10,10);
      TCOD_map_delete(map);
Py  : map = litbcod.map_new(50,50)
      litbcod.map_set_can_see_through(map,10,10,True)
      litbcod.map_compute_fov(map,10,10)
      visible = litbcod.map_is_in_fov(map,10,10)
      litbcod.map_delete(map)
</pre></p>
